<template>
    <div>
      <brand-bar></brand-bar>
      <brand-table :brandInfo='brandInfo' :image = 'image'></brand-table>
    </div>
</template>

<script>
import brandBar from './branditem/brandBar.vue'
import brandTable from './branditem/brandTable.vue'

import {getElecBrand} from '@/network/user'
export default {
  name:'brandView',
  components:{
    brandBar,
    brandTable
  },
  data() {
    return {
      brandInfo:[],
      image:'',
      binaryData :[]
    }
  },
   created() {
    this.getElecBrand()
  },
  methods: {
    async getElecBrand(){
      let res = await getElecBrand()
      console.log('***********获取电动车信息');
      console.log('@',res.data.data);
      let result = res.data.data
      this.brandInfo = result.result
      console.log(result.result);
      this.brandInfo.forEach(item=>{
        console.log('zz',item);
        // console.log(item.logo.data);
        // let logo = item.logo.data
        // this.image = URL.createObjectURL(logo)
        // this.binaryData.push(logo)
        // this.image = window.URL.createObjectURL(new Blob(this.binaryData))
        // console.log(this.image);
      })
      
      // let blob = new Blob([res.])
      // getElecBrand().then(res=>{
      //   console.log('哈哈哈哈哈哈哈哈哈哈哈哈',res);
      // })
    }
  },
}
</script>

<style>

</style>